#定义一个类
# class A:
#     def __init__(self):
#         self.n = 1
#     def print_info(self):
#         print(self.n)


#创建一个子类继承A类为父类
# class B(A):
#     pass
#
# if __name__ == '__main__':
#     #实例化B类
#     b = B()
#     print(b.n)
#     b.print_info()

#1.师父类
class Master(object):
    def __init__(self):
        self.kongfu = "[五香煎饼果子配方]"

    def make_cake(self):
        print(f"运用{self.kongfu}制作煎饼果子")

#定义学校类
class School:
    #初始化方法：
    def __init__(self):
        self.kongfu = "[香辣煎饼果子配方]"
#2徒弟类
class Prentice(School,Master):
    #初始化方法
    def __init__(self):
        self.kongfu = "[独创配方]"
    #定义一个方法
    def make_cake(self):
        print(f"运用{self.kongfu}制作煎饼果子")

#3.创建对象xiaoming
xiaoming = Prentice()
#4.对象访问实例属性
print(xiaoming.kongfu)
#5.对象调用实例方法
xiaoming.make_cake()


